Packaging Apps for Kubernetes
Basic idea of packaging apps for Kubernetes.
We'll cover the following
For an application to run on a Kubernetes cluster, it needs to tick a few boxes. These include:
- Being packaged as a container
- Being wrapped in a Pod
- Being deployed via a declarative manifest file
It goes like this: you write an application service in a language of your choice. You build it into a container image and store it in a registry. At this point, the application service is containerized.
Next, you define a Kubernetes Pod to run the containerized application. At the kind of high level we’re at, a Pod is just a wrapper that allows a container to run on a Kubernetes cluster. Once you’ve defined the Pod, you’re ready to deploy it on the cluster.
Deployments#
It is possible to run a stand-alone Pod on a Kubernetes cluster, but the preferred model is to deploy all Pods via higher-level controllers. The most common controller is the Deployment. It offers scalability, self-healing, and rolling updates. You define Deployments in YAML manifest files that specify things like which image to use and how many replicas to deploy.
Once everything is defined in the Deployment YAML file, you POST it to the API server as the desired state of the application and let Kubernetes implement it.
Kubernetes DNS
Quiz: Kubernetes Principles